package com.smartwebx.ha.web.admin.module.screen.report;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.smartwebx.ha.biz.assign.HaDirectoryManager;
import com.smartwebx.ha.dal.assign.bean.HaDirectory;

public class AjaxEditOrganize {
	@Autowired
	private HaDirectoryManager haDirectoryManager;
	public void execute(@Param("data") String dateJson) throws IOException{
		ObjectMapper mapper = new ObjectMapper();
		mapper.configure(
				DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
		System.out.println(dateJson);
		
		
		HaDirectory haDirectory = mapper.readValue(dateJson,
				HaDirectory.class);
		haDirectoryManager.update(haDirectory);
	}

}